//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "fn_addAmmoAction.sqf"
#include <btc_macros.h>
TRACE_1("Start",_this);

if (isDedicated) exitWith {};

private ["_vec","_action"];
DEFAULT_PARAM(_vec,0,objNull);
_action = _vec getVariable ["BTC_DropAmmo_Action",-1];
if (_action < 0) then {
	_action = _vec addAction [BLUE_TEXT(localize "STR_BTC_DROP_AMMO_BOX"),{_this call FUNC(dropAmmoBox);},[], 8, false, true, "", "alive _target && {alive player} && {(player == vehicle player)} && {(_target getVariable ['BTC_AMMO_LOADED',false])}"];
	_vec setVariable ["BTC_DropAmmo_Action",_action];
	TRACE_1("Added Action",_action);
};
_action = _vec getVariable ["BTC_LoadAmmo_Action",-1];
if (_action < 0) then {
	_action = _vec addAction [BLUE_TEXT(localize "STR_BTC_LOAD_AMMO_BOX"),{_this call FUNC(loadAmmoBox);},[], 8, false, true, "", "alive _target && {alive player} && {(player == vehicle player)} && {[_target] call BTCR_fnc_nearAmmoBox}"];
	_vec setVariable ["BTC_LoadAmmo_Action",_action];
	TRACE_1("Added Action",_action);
};
TRACE("End");